package com.ytjj.qmyx.admin.eunm;

public enum ReasonTypeEnums {

    LOGISTICS_CAUSE(0,"物流原因"),
    QUALITY_CAUSE(1, "质量原因"),
    CLIENT_CAUSE(2, "客户原因"),
    WAREHOUSE_CAUSE(3, "仓库原因"),
    SERVICE_CAUSE(4, "客服原因"),
    RESTS(5, "其他"),
    PLATFORM_CAUSE(6, "平台原因");

    private Integer code;
    private String message;

    ReasonTypeEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (ReasonTypeEnums value : ReasonTypeEnums.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String message){
        for (ReasonTypeEnums value : ReasonTypeEnums.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
